#ifndef T_AUTOMA_MODULES_SLAVES_BLENDERS_PROTOTYPE_HPP
#define T_AUTOMA_MODULES_SLAVES_BLENDERS_PROTOTYPE_HPP

#include "../MotorizedPrototype.hpp"

// driven by an on/off BDC or BLDC motor
struct BlenderOCentrifugeSlave : public MotorizedSlave {
	enum struct CtrlMode {
		Idle,
		Speed,
		Torque,
		Position
	};
	struct State {
		CtrlMode _mode = CtrlMode::Idle;
		float speed = 0;
		float torque = 0;
		float position = 0;
	} _state;

	BlenderOCentrifugeSlave(GeneralSlave* ref);
	~BlenderOCentrifugeSlave();

	int readOut(uint64_t readIndex = 0) override;
	int setModeSpeed(float newSpeed);
	int setModeTorque(float newTorque);
	int setModePosition(float newPos);
	int stop(int hardStop) override;
	int moveInMode(std::wstring mode, float distOrRate);

	std::wstring getCurCoordStr() override;
	std::wstring getTargetCoordStr() override;
	//virtual std::wstring getLimitedStr();
	std::wstring getSpeedStr() override;
	std::wstring getLoadStr() override;

	std::wstring getActionStr() override;

private:
	State _simuStateTarget;
	int simuReadOut(uint64_t readIndex);

protected:
	// if func name matches is listed here, it is used as a axis (in config order)
	virtual std::set<std::wstring> getAxialFuncs() override;
};

#endif